package com.example.decorate;

import com.example.decorate.Impi.B;
import com.example.decorate.extend.CDecorateObject;
import com.example.decorate.extend.DDecorateObject;

/**
 * 装饰器模式，抽象父类来继承同一个接口是因为，可以有多个装饰的效果实现
 */
public class Test {
    public static void main(String[] args) {
        A b = new B();

        b.doSomething();
        System.out.println();

        new CDecorateObject(b).doSomething();
        System.out.println();
        new DDecorateObject(b).doSomething();
    }
}
